package com.itheima.exer.exercise.ex0925;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class PlusDemo1 {
    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.of(2011,11,25,6,7,8);
        LocalDateTime time = now.plusYears(10);
        String format = time.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        String format1 = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        System.out.println(format+"是"+format1+"加了10年之后的时间");
        LocalDateTime time1 = time.minusMonths(25);
        String format2 = time1.format(DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss"));
        System.out.println(format+"减去25个月为"+format2);
    }
}